
#include <cstdio>
#include <algorithm>
#include <cmath>
#include<iostream>
using namespace std;
const int MAX = 200010 ;
const int INF = 2 << 20;
//P1429平面最近点加强版
int temp[MAX] = {0};
struct D{
    double x;
    double y;
}s[MAX];
double calc(int d1, int d2){
    double x = (s[d1].x - s[d2].x) * (s[d1].x - s[d2].x);
    double y = (s[d1].y - s[d2].y) * (s[d1].y - s[d2].y);
    return sqrt(x + y);
}
double calMin(double d1,double d2){
    return d1 < d2 ? d1 : d2;
}
bool cmps(const D &d1,const D &d2){
    if(d1.x == d2.x) return d1.y < d2.y;
    else return d1.x < d2.x;
}
bool cmp(const int &a,const int &b) {return s[a].y<s[b].y;}
double merge(int left,int right){
    int k = 0;
    if(left == right){
        return INF;
    }
    if(left + 1 == right){
        return calc(left , right);
    }
    int mid = (left + right) >> 1;
    double sc1 = merge(left , mid -1);
    double sc2 = merge(mid, right);
    double d = calMin(sc1,sc2);
    for(int i = left; i<=right; i++){
        if(fabs(s[mid].x - s[i].x) < d){
            temp[k++] = i;
        }
    }
    sort(temp,temp+k,cmp);
    for(int i = 0; i<k; i++){
        for(int j = i+1; j<k && s[temp[j]].y - s[temp[i]].y<d ;j++){
            double d3 = calc(temp[i],temp[j]);
            d = d > d3 ? d3 : d;
        }
    }
    return d;
}
int main(void){
    int n;
    cin >> n;
    for(int i = 0; i<n; i++){
        scanf("%lf %lf",&s[i].x,&s[i].y);
    }
    sort(s,s+n,cmps);
    printf("%.4lf\n",merge(0,n-1));
    return 0;
}